home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-9.10-netbook-remix-PL.iso / casper / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / language.rng < prev    next >
Extensible Markup Language  |  2009-10-02  |  11KB  |  373 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com>
  5.  Copyright (C) 2005-2007 Emanuele Aina
  6.  
  7.  This library is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU Library General Public
  9.  License as published by the Free Software Foundation; either
  10.  version 2 of the License, or (at your option) any later version.
  11.  
  12.  This library is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  Library General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU Library General Public
  18.  License along with this library; if not, write to the
  19.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  Boston, MA 02111-1307, USA.
  21.  
  22. -->
  23. <!--
  24.   This file describes the XML format used for syntax highlight
  25.   descriptions for the GtkSourceView 1.x library.
  26.   
  27.   .lang files are XML files which describe how to highlight syntax;
  28.   this RNG is used for validation purposes.
  29.   
  30.   .lang files should be located in $PREFIX/gtksourceview-1.0/language-specs/, 
  31.   or in ~./gnome2/gtksourceview-1.0/language-specs/
  32.   
  33.   To check if a .lang file is valid, run
  34.   
  35.   $ xmllint FILENAME - -relaxng language.rng
  36.   
  37.   If you create a new .lang file or modify an existing one, please note
  38.   that it will be (re)loaded by the application only after it is
  39.   restarted.
  40. -->
  41. <!--
  42.   Boolean type
  43.   
  44.   Attributes that are of type boolean allow the following values:
  45.   
  46.   - 'true', 'TRUE' and '1'     all meaning true
  47.   - 'false', FALSE' and '0'     all meaning false
  48.   
  49.   It is encouraged to use 'TRUE' and 'FALSE' instead of the alternatives.
  50. -->
  51. <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" 
  52.          xmlns="http://relaxng.org/ns/structure/1.0"
  53.          datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  54.   <define name="boolean">
  55.     <choice>
  56.       <value>true</value>
  57.       <value>false</value>
  58.       <value>TRUE</value>
  59.       <value>FALSE</value>
  60.       <value>0</value>
  61.       <value>1</value>
  62.     </choice>
  63.   </define>
  64.   <!--
  65.     Attributes required by all element representing a syntax or pattern tag.
  66.     
  67.     - name        the name of the tag (it can appear in the UI)
  68.     
  69.     - style        the style used to highlight the tag. Recognized values
  70.             are (from gtksourcestylescheme.h):
  71.     
  72.             - Base-N Integer    used for values with a base
  73.                         other than 10
  74.             - Character        used for single characters
  75.             - Comment        used for comments
  76.             - Data Type        used for data types
  77.             - Function        used for function names
  78.             - Decimal        used for decimal values
  79.             - Floating Point    used for floating point values
  80.             - Keyword        used for keywords
  81.             - Preprocessor        used for preprocessor instructions
  82.             - String        used for strings
  83.             - Specials        used for 'special' things
  84.             - Others (DEPRECATED, replaced by "Data Type")
  85.             - Others 2        used for 'other' things
  86.             - Others 3        used for 'other' things
  87.     
  88.     The "name" attribute can be prefixed with "_" to be marked for
  89.     translation.
  90.   -->
  91.   <define name="tagattrs">
  92.     <choice>
  93.       <attribute name="_name">
  94.         <data type="string"/>
  95.       </attribute>
  96.       <attribute name="name">
  97.         <data type="string"/>
  98.       </attribute>
  99.     </choice>
  100.     <attribute name="style">
  101.       <data type="string"/>
  102.     </attribute>
  103.   </define>
  104.   <!--
  105.     The root of the definition file is the element "language".
  106.     
  107.     Required attributes:
  108.     
  109.     - name        the name of the language (it can appear in menus and
  110.             dialog boxes)
  111.     
  112.     - section    the category the language belongs to (e.g. "Sources",
  113.             "Scripts", etc.)
  114.     
  115.     - version    version of the .lang file format (1.0)
  116.     
  117.     - mimetypes    a list of mime-types that identifies the types of file
  118.             that must be highlighted using the .lang file
  119.     
  120.     Optional attributes:
  121.     
  122.     - translation-domain
  123.             the translation domain used by the file
  124.     
  125.     The "name" and "section" attributes can be prefixed with
  126.     "_" to be marked for translation.
  127.   -->
  128.   <define name="language">
  129.     <element name="language">
  130.       <ref name="attlist.language"/>
  131.       <optional>
  132.         <ref name="escape-char"/>
  133.       </optional>
  134.       <oneOrMore>
  135.         <choice>
  136.           <ref name="line-comment"/>
  137.           <ref name="block-comment"/>
  138.           <ref name="string"/>
  139.           <ref name="syntax-item"/>
  140.           <ref name="pattern-item"/>
  141.           <ref name="keyword-list"/>
  142.         </choice>
  143.       </oneOrMore>
  144.     </element>
  145.   </define>
  146.   
  147.   <define name="attlist.language" combine="interleave">
  148.     <choice>
  149.       <attribute name="_name">
  150.         <data type="string"/>
  151.       </attribute>
  152.       <attribute name="name">
  153.         <data type="string"/>
  154.       </attribute>
  155.     </choice>
  156.     <choice>
  157.       <attribute name="_section">
  158.         <data type="string"/>
  159.       </attribute>
  160.       <attribute name="section">
  161.         <data type="string"/>
  162.       </attribute>
  163.     </choice>
  164.     <attribute name="version">
  165.       <data type="string">
  166.         <param name="pattern">1\.0</param>
  167.       </data>
  168.     </attribute>
  169.     <attribute name="mimetypes"/>
  170.     <optional>
  171.       <attribute name="translation-domain"/>
  172.     </optional>
  173.   </define>
  174.   <!-- Which character is used in escape sequences. -->
  175.   <define name="escape-char">
  176.     <element name="escape-char">
  177.       <ref name="attlist.escape-char"/>
  178.       <text/>
  179.     </element>
  180.   </define>
  181.   <define name="attlist.escape-char" combine="interleave">
  182.     <empty/>
  183.   </define>
  184.   <!--
  185.     The line-comment" element represents single line comments.
  186.     The "start-regex" subelement defines the regex matching the start of
  187.     the comment.
  188.   -->
  189.   <define name="line-comment">
  190.     <element name="line-comment">
  191.       <ref name="attlist.line-comment"/>
  192.       <ref name="start-regex"/>
  193.     </element>
  194.   </define>
  195.   <define name="attlist.line-comment" combine="interleave">
  196.     <ref name="tagattrs"/>
  197.   </define>
  198.   <!--
  199.     The "block-comment" element represents multiple lines comments.
  200.     The "start-regex" subelement defines the regex matching the beginning of
  201.     the comment.
  202.     The "end-regex" subelement defines the regex matching the end of
  203.     the comment.
  204.   -->
  205.   <define name="block-comment">
  206.     <element name="block-comment">
  207.       <ref name="attlist.block-comment"/>
  208.       <ref name="start-regex"/>
  209.       <ref name="end-regex"/>
  210.     </element>
  211.   </define>
  212.   <define name="attlist.block-comment" combine="interleave">
  213.     <ref name="tagattrs"/>
  214.   </define>
  215.   <!--
  216.     The "string" element represents string.
  217.     The "start-regex" subelement defines the regex matching the beginning of
  218.     the string.
  219.     The "end-regex" subelement defines the regex matching the end of
  220.     the string.
  221.     
  222.     Optional attributes:
  223.     
  224.     - end-at-line-end    whether the string end at the end of line
  225.   -->
  226.   <define name="string">
  227.     <element name="string">
  228.       <ref name="attlist.string"/>
  229.       <ref name="start-regex"/>
  230.       <ref name="end-regex"/>
  231.     </element>
  232.   </define>
  233.   <define name="attlist.string" combine="interleave">
  234.     <ref name="tagattrs"/>
  235.     <optional>
  236.       <attribute name="end-at-line-end" a:defaultValue="TRUE">
  237.         <ref name="boolean"/>
  238.       </attribute>
  239.     </optional>
  240.   </define>
  241.   <!--
  242.     The "syntax-item" element represents a generic region of the document.
  243.     The "start-regex" subelement defines the regex matching the beginning of
  244.     the region.
  245.     The "end-regex" subelement defines the regex matching the end of
  246.     the region.
  247.   -->
  248.   <define name="syntax-item">
  249.     <element name="syntax-item">
  250.       <ref name="attlist.syntax-item"/>
  251.       <ref name="start-regex"/>
  252.       <ref name="end-regex"/>
  253.     </element>
  254.   </define>
  255.   <define name="attlist.syntax-item" combine="interleave">
  256.     <ref name="tagattrs"/>
  257.   </define>
  258.   <!--
  259.     The "pattern-item" element represents a generic token.
  260.     The "regex" subelement defines the regex matching the token.
  261.   -->
  262.   <define name="pattern-item">
  263.     <element name="pattern-item">
  264.       <ref name="attlist.pattern-item"/>
  265.       <ref name="regex"/>
  266.     </element>
  267.   </define>
  268.   <define name="attlist.pattern-item" combine="interleave">
  269.     <ref name="tagattrs"/>
  270.   </define>
  271.   <!--
  272.     The "keyword-list" element represents a list of keywords, it can have
  273.     one or more "keyword" subelements each one representing a keyword.
  274.     A "keyword" subelement defines the regex matching a keyword of the
  275.     language.
  276.     
  277.     Optional attributes:
  278.     
  279.     - case-sensitive    whether the keywords are case sensitive
  280.     
  281.     - match-empty-string-at-beginning:
  282.                 whether the empty string (\b) should be matched
  283.                 at the beginning of the keywords
  284.     
  285.     - match-empty-string-at-end
  286.                 whether the empty string (\b) should be matched
  287.                 at the end of the keywords
  288.     
  289.     - beginning-regex    if all keywords start with a regex, you can
  290.                 specify    it here to avoid doing it for
  291.                 every single keyword
  292.     
  293.     - end-regex        if all keywords end with a regex, you can
  294.                 specify    it here to avoid doing it for
  295.                 every single keyword
  296.   -->
  297.   <define name="keyword-list">
  298.     <element name="keyword-list">
  299.       <ref name="attlist.keyword-list"/>
  300.       <oneOrMore>
  301.         <ref name="keyword"/>
  302.       </oneOrMore>
  303.     </element>
  304.   </define>
  305.   <define name="attlist.keyword-list" combine="interleave">
  306.     <ref name="tagattrs"/>
  307.     <optional>
  308.       <attribute name="case-sensitive" a:defaultValue="TRUE">
  309.         <ref name="boolean"/>
  310.       </attribute>
  311.     </optional>
  312.     <optional>
  313.       <attribute name="match-empty-string-at-beginning" a:defaultValue="FALSE">
  314.         <ref name="boolean"/>
  315.       </attribute>
  316.     </optional>
  317.     <optional>
  318.       <attribute name="match-empty-string-at-end" a:defaultValue="FALSE">
  319.         <ref name="boolean"/>
  320.       </attribute>
  321.     </optional>
  322.     <optional>
  323.       <attribute name="beginning-regex"/>
  324.     </optional>
  325.     <optional>
  326.       <attribute name="end-regex"/>
  327.     </optional>
  328.   </define>
  329.   <!-- Elements used inside other elements -->
  330.   <define name="keyword">
  331.     <element name="keyword">
  332.       <ref name="attlist.keyword"/>
  333.       <text/>
  334.     </element>
  335.   </define>
  336.   <define name="attlist.keyword" combine="interleave">
  337.     <empty/>
  338.   </define>
  339.   <define name="regex">
  340.     <element name="regex">
  341.       <ref name="attlist.regex"/>
  342.       <text/>
  343.     </element>
  344.   </define>
  345.   <define name="attlist.regex" combine="interleave">
  346.     <empty/>
  347.   </define>
  348.   <define name="start-regex">
  349.     <element name="start-regex">
  350.       <ref name="attlist.start-regex"/>
  351.       <text/>
  352.     </element>
  353.   </define>
  354.   <define name="attlist.start-regex" combine="interleave">
  355.     <empty/>
  356.   </define>
  357.   <define name="end-regex">
  358.     <element name="end-regex">
  359.       <ref name="attlist.end-regex"/>
  360.       <text/>
  361.     </element>
  362.   </define>
  363.   <define name="attlist.end-regex" combine="interleave">
  364.     <empty/>
  365.   </define>
  366.   
  367.   <start>
  368.     <choice>
  369.       <ref name="language"/>
  370.     </choice>
  371.   </start>
  372. </grammar>
  373.